//
// Created by liaohailong on 2025/4/18.
//

#ifndef HELLOVIDEOCACHE_HELLOBITSTREAMHANDLER_HPP
#define HELLOVIDEOCACHE_HELLOBITSTREAMHANDLER_HPP

#include "HelloRequestHandler.hpp"

/**
 * create by liaohailong
 * 2025/4/18 20:50
 * desc: 处理 请求完整 比特流 式的多媒体文件 mp4,flv,ts ...
 */
class HelloBitStreamHandler : public HelloRequestHandler
{
public:
    explicit HelloBitStreamHandler(const std::shared_ptr<HelloCacheManager> &cache);
    ~HelloBitStreamHandler() override ;

    void acceptClient(std::shared_ptr<HelloHttpRequest> request) override ;

private:
    static void OnCompleteCallback(HelloDataFetcher *fetcher, void *userdata);

private:
    // 缓存大管家
    std::shared_ptr<HelloCacheManager> cache;
};


#endif //HELLOVIDEOCACHE_HELLOBITSTREAMHANDLER_HPP
